package com.example.tmxk.dao;

import com.example.tmxk.util.DBConnection;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class AdminDao1 {
    //DBConn对象 代表了My
    DBConnection DBConn = new DBConnection();
    public boolean CheckLogin(String s1,String s2) throws SQLException {
        DBConnection DBConn = null;
        Connection conn = DBConn.getConn();
        Statement stmt = conn.createStatement();
        ResultSet rs = null;
        boolean ture = false;
        boolean OK = ture;
        String sql = "select * from admin where AdminName= '"+s1+"' and AdminPwd= '"+ s2+"'";
        Statement stme = null;
        rs = stmt.executeQuery(sql);
        if(!rs.next()){
            OK = false;
        }
        return OK;
    }

}
